Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mavis Market to nft.trades #7355

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

peterrliem
Copy link
Contributor

Thank you for contributing to Spellbook 🪄

Please open the PR in draft and mark as ready when you want to request a review.

Description:

[...]


quick links for more information:

@github-actions github-actions bot marked this pull request as draft December 19, 2024 08:10
@github-actions github-actions bot added WIP work in progress dbt: nft covers the NFT dbt subproject labels Dec 19, 2024
@0xRobin 0xRobin self-assigned this Dec 20, 2024
@Murshadddd
Copy link

#7234

@0xRobin 0xRobin marked this pull request as ready for review December 23, 2024 10:26
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Dec 23, 2024
Copy link
Collaborator

@0xRobin 0xRobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some questions/comments around data QA.
It would also be nice to add a seed test to the model.
You can see how that is done for collectionswap here:
seed: https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/nft/seeds/trades/base_trades/collectionswap_ethereum_base_trades_seed.csv
schema:

- name: collectionswap_ethereum_base_trades_seed
config:
column_types:
tx_hash: varbinary
buyer: varbinary
seller: varbinary
nft_contract_address: varbinary
price_raw: uint256
platform_fee_amount_raw: uint256
royalty_fee_amount_raw: uint256
nft_token_id: uint256

test:
- check_seed:
seed_file: ref('collectionswap_ethereum_base_trades_seed')
match_columns:
- block_number
- tx_hash
- sub_tx_trade_id
check_columns:
- buyer
- seller
- nft_contract_address
- nft_token_id
- price_raw
- platform_fee_amount_raw
- royalty_fee_amount_raw

quantity as nft_amount,
seller,
buyer,
'' as trade_category,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 'Buy' or 'Sell'.
If it's not possible to determine the trade direction, feel free to just set 'Buy' as the default.

seller,
buyer,
'' as trade_category,
'' as trade_type,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 'secondary'

cast(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.erc') as double) as erc,
FROM_HEX(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.addr')) as nft_contract_address,
cast(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.id') as double) as nft_token_id,
cast(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.quantity') as double) as quantity,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to return 0 in quite some cases, it should always be 1 or greater

contract_address as project_contract_address,
tx_hash,
platform_address as platform_fee_address,
platform_fee_amount_raw,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always returns 200 currently which seems to be the ratio and not the actual raw value?

Comment on lines +79 to +80
-- axie_fee_amount_raw,
-- ronin_treasury_fee_amount_raw,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want, you can keep these in this model.
They won't make it into nft.trades but at least they'll be available in the project specific model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbt: nft covers the NFT dbt subproject ready-for-review this PR development is complete, please review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants